﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace ClassDemo
{
    public class People
    {
        public string Name { get; set; }
        //prop + tab键
        public string Sex { get; set; }
        /// <summary>
        /// 构造函数,无参构造，系统默认存在
        /// </summary>
        /// <param name="name">姓名</param>
        /// <param name="sex">姓名</param>
        public People(string name, string sex)
        {
            //使用参数给属性赋值
            this.Name = name;
            this.Sex = sex;
        }

        public void Info()
        {
            Console.WriteLine("姓名:{0} 性别:{1}", Name, Sex);
        }

    }
}
